Release 10.1A: OpenEdge Development:
Programming Interfaces
Listening and responding to connection requests
After you enable a server socket for listening using the
ENABLE-CONNECTIONS( )method, Progress listens on the specified port for client connections. When a socket client sends a connection request to this port, Progress automatically accepts the connection.After accepting the connection, Progress posts a
CONNECTevent on the server socket and calls theCONNECTevent procedure that you have specified using theSET-CONNECT-PROCEDURE( )method. TheCONNECTevent procedure executes, returning a handle to a socket object created by Progress and passed as a parameter to the event procedure context. This socket object, then, is the communications endpoint for the connection on the server.
![]()
To listen for connections on a server socket using the
CONNECTevent procedure:
- Define an internal procedure that takes one
INPUTparameter of typeHANDLEto serve as an event procedure. You can define this procedure in any procedure context that is active while listening for connections.- Specify the procedure you defined in Step 1 as a
CONNECTevent procedure by invoking theSET-CONNECT-PROCEDURE( )method on the server socket handle that you have enabled for listening.- Include blocking I/O statements (such as
WAIT-FOR) orPROCESS EVENTSstatements in your code to handle events. When anyCONNECTevent is received in the context of one of these statements, the event procedure specified in Step 2 executes.Once you have the handle to a connected socket object, you can read and write data on the socket, and otherwise manage the socket for the connection. For more information, see the "Read, writing, and managing sockets on clients and servers" section.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |